#include<string>
#include<vector>
#include <iostream>

using namespace std;
class Solution {
public:
    vector<string> fizzBuzz(int n) {
        vector<string> result;
        const short NUM_MAX_LEN = 5;
        const string strFizz("Fizz");
        const string strBuzz("Buzz");
        const string strFizzBuzz("FizzBuzz");
        for(int i = 1; i < n+1; i++)
        {
            bool isFizz = false;
            bool isBuzz = false;
            if((i % 3) == 0) isFizz = true;
            if((i % 5) == 0) isBuzz = true;
            if(!isFizz && !isBuzz)
            {
                char num[NUM_MAX_LEN+1] = {0};
                char* p = num+NUM_MAX_LEN-1;
                for(int j = 0; j < NUM_MAX_LEN; j++)
                {
                    int tempI = i;
                    for(int k = 0; k < j; k++) tempI = tempI/10;
                    if(tempI == 0) break;
                    *p = tempI % 10 + '0';
                    p--;
                }
                p++;
                result.emplace_back(p);
                // result.push_back(to_string(i));
            }
            else if(isFizz && !isBuzz)
            {
                result.emplace_back(strFizz);
            }
            else if(!isFizz && isBuzz)
            {
                result.emplace_back(strBuzz);
            }
            else{
                result.emplace_back(strFizz+strBuzz);
            }
        }
        return result;
    }
};

int main()
{
    Solution s;
    vector<string> vstr = s.fizzBuzz(15);
    cout << '[';
    for(auto str : vstr)
    {
        cout << "\"" << str << "\",";
    }
    cout << "]" << endl;

    return 0;
}